package com.siecomzg.tool;


import java.util.ArrayList;
import java.util.List;

/**
 * Created by admin on 2018/1/10.
 */

public class ParsePoint {


    public static List<Point> parse(byte[] data) {

        LogUtil.e("datalength",data.length+"--");
        List<Point> list = new ArrayList<Point>();
        int i = 0;
        for (; i < data.length; i=i+8) {
            byte[] pack = new byte[8];
            System.arraycopy(data,i,pack,0,8);
            Point point = new Point();
            point.setX(ByteTool.getShort(pack[3],pack[2]));
            point.setY(ByteTool.getShort(pack[5],pack[4]));
            point.setT(ByteTool.getShort(pack[7],pack[6]));
            list.add(point);
        }
        LogUtil.e("i_value" , String.valueOf(i));
        return list;

    }


}
